<template>
  <div class="app-container">
    <el-row>
      <el-col :span="12" :offset="6">
        <el-result icon="error" title="404" sub-title="页面不存在"/>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="6" :offset="6" class="text-center text-top">
        <el-button icon="el-icon-arrow-left" @click="back">返回</el-button>
      </el-col>
      <el-col :span="6" class="text-center text-top">
        <el-button icon="el-icon-s-home" @click="dashboard">控制台</el-button>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12" :offset="6" class="text-center text-top">

      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'Error404',
  data() {
    return {}
  },
  methods: {
    back() {
      if (this.$route.query.noGoBack) {
        this.$router.push({path: '/dashboard'})
      } else {
        this.$router.go(-1)
      }
    },
    dashboard() {
      this.$router.push({path: '/dashboard'})
    }
  }
}
</script>

<style lang="scss" scoped>
.text-center {
  text-align: center;
}
.text-top {
  margin-top: 2vh;
}
</style>
